package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TBookReturnInfoMapper;
import com.ruoyi.system.domain.TBookReturnInfo;
import com.ruoyi.system.service.ITBookReturnInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 还书记录Service业务层处理
 * 
 * @author returnInfo
 * @date 2022-06-08
 */
@Service
public class TBookReturnInfoServiceImpl implements ITBookReturnInfoService 
{
    @Autowired
    private TBookReturnInfoMapper tBookReturnInfoMapper;

    /**
     * 查询还书记录
     * 
     * @param id 还书记录主键
     * @return 还书记录
     */
    @Override
    public TBookReturnInfo selectTBookReturnInfoById(Long id)
    {
        return tBookReturnInfoMapper.selectTBookReturnInfoById(id);
    }

    /**
     * 查询还书记录列表
     * 
     * @param tBookReturnInfo 还书记录
     * @return 还书记录
     */
    @Override
    public List<TBookReturnInfo> selectTBookReturnInfoList(TBookReturnInfo tBookReturnInfo)
    {
        return tBookReturnInfoMapper.selectTBookReturnInfoList(tBookReturnInfo);
    }

    /**
     * 新增还书记录
     * 
     * @param tBookReturnInfo 还书记录
     * @return 结果
     */
    @Override
    public int insertTBookReturnInfo(TBookReturnInfo tBookReturnInfo)
    {
        tBookReturnInfo.setCreateTime(DateUtils.getNowDate());
        return tBookReturnInfoMapper.insertTBookReturnInfo(tBookReturnInfo);
    }

    /**
     * 修改还书记录
     * 
     * @param tBookReturnInfo 还书记录
     * @return 结果
     */
    @Override
    public int updateTBookReturnInfo(TBookReturnInfo tBookReturnInfo)
    {
        tBookReturnInfo.setUpdateTime(DateUtils.getNowDate());
        return tBookReturnInfoMapper.updateTBookReturnInfo(tBookReturnInfo);
    }

    /**
     * 批量删除还书记录
     * 
     * @param ids 需要删除的还书记录主键
     * @return 结果
     */
    @Override
    public int deleteTBookReturnInfoByIds(String ids)
    {
        return tBookReturnInfoMapper.deleteTBookReturnInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除还书记录信息
     * 
     * @param id 还书记录主键
     * @return 结果
     */
    @Override
    public int deleteTBookReturnInfoById(Long id)
    {
        return tBookReturnInfoMapper.deleteTBookReturnInfoById(id);
    }
}
